using System;
using System.Drawing;
using System.Collections.Generic;
using TTDotNet.Engine.GUI.Buttons;
using TTDotNet.Engine.GUI.Windows;
using TTDotNet.Engine.ThreeDEngine;

namespace TTDotNet.Engine.GUI.Buttons
{
    public class CloseButton : GameButton
    {
        private Window parentWindow;

        public CloseButton(RectangleF screenRect, GameTexture up, GameTexture down, Window window) : base(screenRect, "", 1, Color.Black, "Arial", up, down)
        {
            parentWindow = window;
        }

        protected override void OnMouseRelease(Point cursor)
        {
            if (Contains(cursor))
            {
                parentWindow.Close();
            }
        }
    }
}
